package com.lzy.shops.utils;

import lombok.Data;
import org.springframework.stereotype.Component;

@Data
public class ResponseData<T> {
    // 状态码
    private Boolean state;
    // 数据
    private T data;
    // 描述信息
    private String msg;

    // 成功返回数据
    public ResponseData(Boolean state, T data, String msg) {
        this.state = state;
        this.data = data;
        this.msg = msg;
    }

    // 成功返回数据
    public ResponseData(Boolean state, T data) {
        this.state = state;
        this.data = data;
    }

    // 失败返回数据
    public ResponseData(Boolean state, String msg) {
        this.state = state;
        this.msg = msg;
    }
}
